determine the absolute and local max min